<?php
if (!defined('W_ROOT')) {
	exit();
}
$star = '<span style="color:red">*</span>';
$errormsg = (isset($_GET['error']) && $_GET['error'] != '') ? $_GET['error'] : '';
$id = isset($_GET['id'])?$_GET['id']:0;
$name = $fee = $desc = $limitpro =  $txtexpired = $display_image = $display_map = $isHomepage = "";
$prescription = $txtbanner = 'no';
$sql = "SELECT * FROM tbluser_account_type WHERE id = $id";
$result = mysql_query($sql);
if(dbNumRows($result)){
	$row = mysql_fetch_assoc($result);

	$id = $row['id'];
	$name = $row['account_type_name'];
	$fee = $row['account_price'];
	$desc = stripslashes($row['description']);
	$limitpro = $row['limit_product'];
	$txtbanner = $row['banner_ads'];
	$txtexpired = $row['account_expire'];
	$prescription = $row['prescription'];
	$display_image = $row['display_image'];
	$display_map = $row['display_map'];
	$isHomepage = $row['isHome'];
}
?>
<script type="text/javascript" src="<?php echo W_ROOT;?>/jscripts/initialeditor.js"></script>
<style type="text/css">
.hide{
	display:none;
}
</style>
<div class="breadcrumb">
        <a href="<?php echo base_url_admin;?>"><?php echo $lang['HOME'];?></a>
         :: <?php echo $lang['ACC_INFO'];?>
      </div>
       <div class="box">
       <?php
        	if(!empty($_GET['error']) && $_GET['error']=='required'){
 ?>
 		<div  class="warning"><?php echo $lang['MESSAGE_REQUIR'];?></div>
 <?php
        	}
        ?>
       <div class="heading">
	<h1><img src="../templates/image/user-group.png" alt="" />

			<?php echo $lang['ACC_INFO']; ?> &nbsp;&nbsp;&nbsp;<span class="required">(*) all asterisks must be required!</span>

	</h1>
	<form action="process.php?action=add" method="post" enctype="multipart/form-data" id="form" class="form-validation">
	<div class="buttons">
		 <input class="button" type="submit" name="btnsave" value="<?php echo $lang['SAVE']; ?>" />
            <input class="button" type="reset" name="btnreset" value="<?php echo $lang['RESET']; ?>" />
            <a class="button" href="index.php?view=list"><?php echo $lang['BACK']; ?></a>
	</div>

</div>
<div class="content">
<div class="row">
<form action="process.php?action=add" method="post" enctype="multipart/form-data" name="frmaccount" id="frmaccount">
<table align="center" cellpadding="5" cellspacing="5" width="99%">
  <tr>
   <td align="left" width="180"><?php echo $lang['ACC_NAME']; ?> <font color="#FF0000">*</font></td>
   <td align="left" width="10">:</td>
   <td align="left"><input name="txtName" type="text" value="<?php echo $name?>" style="width:350px;" required/></td>
  </tr>
  <tr>
   <td align="left"><?php echo $lang['FEE']; ?></td>
   <td align="left" width="10">:</td>
   <td align="left"><input name="txtFee" id="txtFee" type="text" value="<?php echo $fee?>" style="width:100px;" /> $
   </td>
  </tr>
  <tr>
   <td align="left"><?php echo $lang['PRO_LIMIT']; ?></td>
   <td align="left" width="10">:</td>
   <td align="left"><input name="prolimited" type="text" value="<?php echo $limitpro?>" style="width:100px;" />
   <span style="color:#666"><?php echo $lang['PUT0_UNLIMIT']; ?></span>
   </td>
  </tr>
  <tr>
   <td align="left"><?php echo $lang['ACC_EXPIRE']; ?></td>
   <td align="left" width="10">:</td>
   <td align="left">
   <input type="radio" name="account_expire" value="0" class="closebox1" <?php echo($txtexpired==0)?' checked="checked"':''?> />&nbsp;<?php echo $lang['NO']; ?>&nbsp;&nbsp;&nbsp;
   <input type="radio" name="account_expire" value="1" class="openbox1" <?php echo($txtexpired!=0)?' checked="checked"':''?> />&nbsp;<?php echo $lang['YES']; ?>&nbsp;&nbsp;&nbsp;
   <input name="txtexpired" class="txtexpired" type="text" value="<?php echo($txtexpired!=0)?$txtexpired:''?>" style="width:100px;" <?php echo($txtexpired==0)?'disabled="disabled"':''?> />
   <span style="color:#666">/<?php echo$lang['DAYS']; ?></span>
   </td>
  </tr>
   <tr>
   <td align="left" valign="top"><?php echo $lang['DISCRIPTION']; ?></td>
   <td valign="top" align="left">:</td>
   <td align="left">
	<textarea name="texteditor" rows="10" cols="80" style="width: 35%"><?php echo $desc;?></textarea>
    <input type="hidden" name="hidid" value="<?php echo $id;?>" />
   </td>
  </tr>
 </table>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url; ?>admin/templates/javascript/ckeditor/ckeditor.js"></script>
<script>
    $(document).ready(function() {
        CKEDITOR.replace('txtdesc', { });
    });
</script>